﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TicketPopup.aspx.cs" Inherits="CROSLAND.WebApp.Impresion.TicketPopup" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Comprobante de Venta</title>
    <script type="text/javascript">
            function PrintReport() {
                var viewerReference = $find("rvGeneral");

                var stillonLoadState = viewerReference.get_isLoading();

                if (!stillonLoadState) {

                    var reportArea = viewerReference.get_reportAreaContentType();
                    if (reportArea == Microsoft.Reporting.WebFormsClient.ReportAreaContent.ReportPage) {
                        $find("rvGeneral").invokePrintDialog();
                    }
                }
            }
     </script>
     <style type="text/css">
 .content-report
{
	width:auto;	
	border:1px solid #DBDBDB;	
	height:600px;
	margin:0; 
	padding:0; 
	vertical-align:top;
	background-color:#fff;		
}

.cnt-print-ticket
{
	height:30px;
	width:100%;
	background-color:#5D7B9D;	
	line-height:30px;	
}

.cnt-print-ticket a
{
	color:#fff;	
	text-align:right;
	float:right;
	margin-right:15px;
	font-weight:bold;
	
}
.cnt-print-ticket a:hover
{	
	text-decoration:underline;
}
     
     </style>


</head>
<body style="top:0; left:0; margin:0">
    <form id="fComprobante" runat="server">
   
       <asp:ToolkitScriptManager ID="smGeneral" runat="server" ScriptMode="Release">
        </asp:ToolkitScriptManager>
      
      <div class="content-report">
        <div class="cnt-print-ticket">
         <a href="JavaScript:PrintReport()">Imprimir Ticket</a>
      </div>
      <rsweb:ReportViewer ID="rvGeneral" runat="server" Width="100%" ShowToolBar="False"
             style="padding-top:0; margin-top:0; top:0; vertical-align:top"
             BackColor="#FFF"  ShowFindControls="False" SplitterBackColor="White" 
             Height="560px" KeepSessionAlive="False" Font-Names="Verdana" Font-Size="8pt" 
                InteractiveDeviceInfos="(Collection)" WaitMessageFont-Names="Verdana" 
                WaitMessageFont-Size="14pt" >
         <LocalReport ReportPath="Impresion\TicketVentaReport.rdlc">
             <DataSources>
                 <rsweb:ReportDataSource DataSourceId="odsComprobante" Name="dsTicketVenta" />
             </DataSources>
         </LocalReport>                
      </rsweb:ReportViewer>                    
      <asp:ObjectDataSource ID="odsComprobante" runat="server" 
           SelectMethod="obtenerImpresionTicket" 
           TypeName="CROSLAND.BL.BC.ImpresionBC">
           <SelectParameters>                   
               <asp:SessionParameter Name="pNroPedido" SessionField="NroPedido"  DefaultValue="" Type="String" />
               <asp:SessionParameter Name="pDocumento" SessionField="Folio"  DefaultValue="" Type="String" />                         
           </SelectParameters>
      </asp:ObjectDataSource>         
      </div>
    </form>
</body>
</html>
